function HandleDialogModifyDesign(gui, item, options) {
  this._gui = gui;
  this._item = item;
  this._options = options;
  
  this._user = (options && options.user) ? options.user : null;
  this._date = (options && options.date) ? options.date : null;
  this._samples = (options && options.samples) ? options.samples : null;
  this._createElements();
};

HandleDialogModifyDesign.prototype._createElements = function() {
  var table, tr, td, radio, input, unique = MiscUtils.unique(), _self = this;
  
  DlmanageUtils.clear(this._gui);
  
  var sample = DlmanageUtils.sample(this._item, this._options.samples);
  if (sample) {
    for (var i = 0, il = sample.attributes.length; i < il; i++) {
      var attribute = sample.attributes[i];
      var gattribute = this._gui.attributes[i];
      gattribute.name.appendChild(document.createTextNode(attribute.name));
      for (var j = 0, jl = attribute.options.length; j < jl; j++) {
        var option = attribute.options[j];
        var goption = gattribute.options[j];
        goption.name.style.color = '#000000';
        goption.name.appendChild(document.createTextNode(option.name));
        goption.name._attribute = attribute;
        goption.name._option = option;
        goption.name.onclick = function() { DlmanageUtils.purchaseChoose(_self._item, this._attribute, this._option);
                                            _self._createElements.call(_self);
                                          };
        if (DlmanageUtils.chosen(this._item, attribute, option)) {
          goption.name.style.color = '#ff0000';
        }
      }
    }
  }
  
  this._gui.product.appendChild(document.createTextNode(this._item.name));
  this._gui.quantity.appendChild(document.createTextNode(this._item.quantity));
};